(Etch folder - clamp plate periphery - example program 4)
(20th January 2014)
(MEW)
(for Mach3)
()
(Machines the periphery but not the sloped section of the nose)
()
()
(Set X0 Y0 at the left front corner)
(Set Z0 at the top surface of the work)
(Safe Z is clear of the work and all obstacles at Z20. Adjust as necessary if you are using a different setup to the one shown in MEW)
()
(Tool is a 6mm dia end mill)
()
(Program sets speed to 3000rpm, which is too slow for a 6mm cutter machining aluminium)
(Feed rate has been adjusted to 100mm/min to compensate somewhat)
()
()
(------------------ Main Program ---------------)
()
()
(Initialisation sequence)
G17 (use the XY plane)
G21 (Set the units to mm)
G40 (Cancel cutter compensation)
G49 (Cancel tool length offsets)
G54 (Use co-ordinate system 1)
G61 (Exact path mode)
G80 (cancel canned cycle mode)
G90 (Use absolute distances)
G91.1 (Use incremental distances for arcs)
G92.1 (Cancel co-ordinate system offsets)
G94 (Set feed per minute mode)
G98 (Set the canned cycle retract behaviour)
()
()
(#41 will contain Z depth of cut)
(#42 will contain Y value)
()
()
S3000
M3
F100
()
()
G0 Z20 (Safe Z)
()
()
(Trim front edge)
#41=0 (Parameter 41 holds the Z depth of cut)
G0 X150 Y48.1
M98 P120 L10
G0 Z-10
G1 X-10
G0 Y48 (Y position for finished size)
G1 X150
G0 Z20
()
()
(Cut the stepped slope to form the nose)
(Begin at the top)
#41=0 (Z depth of cut)
#42=38.2 (Y distance: - would be 38.675 for 9.525mm material)
G0 X150 Y48
M98 P130 L7 (7 repetitions, to leave the bottom 3mm uncut)
G0 Z20 (Safe Z)
()
()
(Rough out the profile)
G0 X-3.1 Y-9.1
G0 Z0
#41=0
M98 P140 L10 (10 repetitions to cut to full depth)
()
()
(Cut the finished profile)
G1 X-3 Y-9
#41=-10 (Set Z to full depth)
M98 P150 L1 (One pass at full depth. L1 could be omitted.)
G0 Z20 (Safe Z)
G0 X0 Y0
() 
M5
M30
()
()
(------------ Subroutine definitions follow ----------------)
()
()
O120 (Trim the front edge 0.1mm oversize)
(Entry assumes CP at X150 Y48.1)
(Exits with CP at X150 Y48.1)
#41=[#41 - 1] (Z depth decremented)
G0 Z#41 (Down to depth of cut)
G1 X-10 (Cut along until clear of left edge)
G0 Z1 (Lift cutter clear of work)
G0 X150 (Back to the start, ready for a further cut)
M99
()
()
O130 (Cut the "front" profile as a series of steps)
(Entry assumes CP is at X150 Y48)
(Exits with #41 holding Z height for next step)
(and #42 holding Y value to machine the rear of the next step)
(and CP at X150 Y#42 Z#41)
F100
G0 Z#41
G0 Y[#42 + 0.1] (Increase Y distance by 0.1mm for this roughing pass)
G1 X-10 (Cut beyond the left end of the work)
G0 Y#42 (Position for a finishing cut by climb milling)
G1 X150 (Cut back to the start)
G0 Y48
#41 = [#41-1] (Lower Z height for next step.)
(Alter to #41 - 0.9321 for 9.525 material)
#42 = [#42 + 1] (Increase Y value for next step.) 
(Alter to Y + 0.9321 for 9.525 material)
M99
()
()
O140 (Recesses: roughing cut)
(Entry assumes CP is at X-3.1 Y-9.1 Z0)
(Exits with CP at X-3.1 Y-9.1 Z#41)
#41=[#41-1]
F100
G2 X-3.1 Y-3.1 I0 J3 Z#41 (Entry curve)
G1 X140.000 Y-3.100 (Along to first corner)
G3 X143.100 Y0.000 I0.000 J3.100 (Around first corner)
G1 X143.1 Y45 (Up to top right corner)
G3 X140.000 Y48.100 I-3.100 J0.000 (Around to top edge)
G1 X130.000 Y48.100 (Along to corner of first cut out)
G3 X126.900 Y45.000 I0.000 J-3.100 (Round into the cut out) 
G1 X126.900 Y31.500 (Down the straight leg)
G2 X126.100 Y31.500 I-0.400 J0.000 (Around the semi-circular bottom curve)
G1 X126.100 Y45.000 (Up the straight side to the top corner)
G3 X123.000 Y48.100 I-3.100 J0.000 (Around the corner onto the top straight)
G1 X119.000 Y48.100 (Along to the corner at the top of the next cut out)
G3 X115.900 Y45.000 I0.000 J-3.100
G1 X115.900 Y31.500
G2 X115.100 Y31.500 I-0.400 J0.000
G1 X115.100 Y45.000
G3 X112.000 Y48.100 I-3.100 J0.000
G1 X108.000 Y48.100
G3 X104.900 Y45.000 I0.000 J-3.100
G1 X104.900 Y41.500
G2 X104.100 Y41.500 I-0.400 J0.000
G1 X104.100 Y45.000
G3 X101.000 Y48.100 I-3.000 J0.000
G1 X85.000 Y48.100
G3 X81.900 Y45.000 I0.000 J-3.100
G1 X81.900 Y31.500
G2 X81.500 Y31.100 I-0.400 J0.000
G1 X73.500 Y31.100
G2 X73.100 Y31.500 I0.000 J0.400
G1 X73.100 Y45.000
G3 X70.000 Y48.100 I-3.100 J0.000
G1 X58.000 Y48.100
G3 X54.900 Y45.000 I0.000 J-3.100
G1 X54.900 Y31.500
G2 X54.100 Y31.500 I-0.400 J0.000
G1 X54.100 Y45.000
G3 X51.000 Y48.100 I-3.100 J0.000
G1 X26.000 Y48.100
G3 X22.900 Y45.000 I0.000 J-3.100
G1 X22.900 Y31.500
G2 X22.100 Y31.500 I-0.400 J0.000
G1 X22.100 Y45.000
G3 X19.000 Y48.100 I-3.100 J0.000
G1 X-3.100 Y48.100
G1 X-3.100 Y-9.100
M99
()
()
O150 (Recesses: finishing cut - climb milling)
(Entry assumes CP is at X-3 Y-9 Z#41)
(Exits with CP at X-3 Y-9 Z#41)
F100
G0 Z#41
G0 X-3 Y-0.1
G1 X-3.000 Y45.000
G2 X.000 Y48.000 I3.000 J0.000
G1 X19 Y48
G2 X22.000 Y45.000 I0.000 J-3.000
G1 X22.000 Y31.500
G3 X23.000 Y31.500 I0.500 J0.000
G1 X23.000 Y45.000
G2 X26.000 Y48.000 I3.000 J0.000
G1 X51.000 Y48.000
G2 X54.000 Y45.000 I0.000 J-3.000
G1 X54.000 Y31.500
G3 X55.000 Y31.500 I0.500 J0.000
G1 X55.000 Y45.000
G2 X58.000 Y48.000 I3.000 J0.000
G1 X70.000 Y48.000
G2 X73.000 Y45.000 I0.000 J-3.000
G1 X73.000 Y31.500
G3 X73.500 Y31.000 I0.500 J0.000
G1 X81.500 Y31.000
G3 X82.000 Y31.500 I0.000 J0.500
G1 X82.000 Y45.000
G2 X85.000 Y48.000 I3.000 J0.000
G1 X101.000 Y48.000
G2 X104.000 Y45.000 I0.000 J-3.000
G1 X104.000 Y41.500
G3 X105.000 Y41.500 I0.500 J0.000
G1 X105.000 Y45.000
G2 X108.000 Y48.000 I3.000 J0.000
G1 X112.000 Y48.000
G2 X115.000 Y45.000 I0.000 J-3.000
G1 X115.000 Y31.500
G3 X116.000 Y31.500 I0.500 J0.000
G1 X116.000 Y45.000
G2 X119.000 Y48.000 I3.000 J0.000
G1 X123.000 Y48.000
G2 X126.000 Y45.000 I0.000 J-3.000
G1 X126.000 Y31.500
G3 X127.000 Y31.500 I0.500 J0.000
G1 X127.000 Y45.000
G2 X130.000 Y48.000 I3.000 J0.000
G1 X140.000 Y48.000
G2 X143.000 Y45.000 I-3.000 J-3.000
G1 X143.000 Y0.000
G2 X140 Y-3 I-3 J0
G1 X-3 Y-3
G3 X-3.000 Y-9.000 I0 J-3
M99


